import { useState } from 'react'

export function useWorkoutNoteForm(initialWorkout) {
  const [formData, setFormData] = useState({
    workoutId: initialWorkout?.id || '',
    workoutName: initialWorkout?.name || '',
    content: '',
    mood: '5',
    intensity: '3',
    duration: ''
  })

  const handleChange = (field, value) => {
    setFormData(prev => ({ ...prev, [field]: value }))
  }

  const resetForm = () => {
    setFormData({
      workoutId: initialWorkout?.id || '',
      workoutName: initialWorkout?.name || '',
      content: '',
      mood: '5',
      intensity: '3',
      duration: ''
    })
  }

  return {
    formData,
    handleChange,
    resetForm
  }
}